package com.cqgc.service;

import com.cqgc.pojo.dto.UserDTO.*;
import com.cqgc.pojo.entity.PageResult;
import com.cqgc.pojo.entity.Result;
import com.cqgc.pojo.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserService {
    //登录
    User login(UserLoginDTO loginDTO);

    //查询用户信息
    User findByUsernameAndPhoneNumber(UserForgetDTO userForgetDTO);

    //跟新用户密码
    int update(User user);

    //判断账户是否被锁
    boolean isAccountLocked(String account);

    //登录失败次数
    void incrementFailedLoginAttempts(String account);

    // 重置登录失败次数
    void resetFailedLoginAttempts(String account);

    int findUidByAccount(String account);

    List<String> getUserRoleInfoMapper(@Param("uid") int uid);

    //查询用户信息
    User findByUser(int uid);

    List<String> getUserPermissionInfoMapper(@Param("roles") List<String> roles);

    PageResult list(UserPageQueryDTO userPageQueryDTO);

    String findPwdByid(Integer uid);

    void updatePwd(String newPwd);

    int update1(UpdateUserDTO updateUserDTO);

    UserRegisterDTO findUserByPhone(String phone);

    int register(UserRegisterDTO userRegisterDTO);

    //新增用户
    int add(AddUserDTO user);

    User findAccount(String account);


    List<User> findUserByRole(int realname);

    int findRoleByUid(int uid);


    void updateAvatar(UpdateUserAvatarDTO updateUserAvatarDTO);


    String getImgUrl();


    PageResult findUserByIf(LikeUserDTO likeUserDTO);

    int delete(int uid);

    int resetPwd(Integer uid);
}
